home *** CD-ROM | disk | FTP | other *** search
- Path: news.voicenet.com!news
- From: kobak@voicenet.com (Peter Kobak)
- Newsgroups: comp.lang.c++
- Subject: Re: Constructor Called for Global Class Instance
- Date: 7 Feb 1996 22:42:13 GMT
- Organization: Voicenet - Internet Access - (215)674-9290
- Message-ID: <4fb9s5$dpd@news.voicenet.com>
- NNTP-Posting-Host: ivyland253.voicenet.com
- X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
-
- In message <4f94ri$12p@dub-news-svc-3.compuserve.com> -
- <72421.1131@compuserve.com> writes:
- :>// Snipet
- :>#include "MyClass.h"
- :>MyClass junk;
- :>
- :>int main(int ac, char **av)
- :>{
- :>
- :>etc....
- :>
- :>Given that there is a constructor MyClass(), if I load this sucker up in a debugger
- :>and set a breakpoint in the constructor function, should I break in the function?
-
- Yes, assuming your debugger knows what it's doing.
-
- :>In other words, does the constructor of a class get called when the class is
- :>defined outside of an executed function?
-
- Yes, before main().
-
- :>And if this is a RTF FAQ, sorry; please point to the FAQ.
-
- rtfm.mit.edu/pub/usenet/comp.lang.c++/*
-
- ================
- Peter Kobak
- kobak@voicenet.com
-
-